package com.mybatis.crudservice.tools;

import lombok.Data;

import java.io.Serializable;

@Data
public class ResultBean<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    private T data;

    private String msg = "success";

    private int code = SUCCESS;

    public ResultBean() {
        super();
    }

    public ResultBean(T data) {
        super();
        this.data = data;
    }

    public ResultBean(Throwable e) {
        super();
        this.msg = e.toString();
        this.code = FAIL;
    }

	public static final int NO_LOGIN = -1;//没有登陆

	public static final int SUCCESS = 0;//成功

	public static final int FAIL = 1;//失败

	public static final int NO_PERMISSION = 2;//没有权限

    public static final int ORM = 3;//ORM异常


}
